/*
 * @Author: szx
 * @Date: 2022-03-26 13:20:42
 * @LastEditTime: 2022-03-26 13:27:15
 * @Description:
 * @FilePath: \leetcode\剑指offer\50\50.js
 */
/**
 * @param {string} s
 * @return {character}
 */
var firstUniqChar = function (s) {
    const map = new Map();
    for (let i of s) {
        map.set(i, (map.get(i) || 0) + 1);
    }
    for (let [index, value] of map) {
        if (value == 1) return index;
    }
    return ' '
};
